package com.xauto.pioneer.appuser.model;

import org.json.JSONObject;

/**车辆损伤信息
 * Created by Ellis.Li on 2017/5/12.
 */
public class CarDamageInfo extends BaseModel<CarDamageInfo> {

    /** 损伤ID*/
    public String car_damage_id;
    /** 损伤位置类型 (1-外部/2-内部/0-其他)*/
    public String damage_pos_type;
    /** 位置编号(外部:1-13)*/
    public String pos_no;
    /** 损伤图片*/
    public Image damage_image;

    @Override
    public CarDamageInfo parse(JSONObject jsonObject) {
        if(jsonObject != null) {
            car_damage_id = jsonObject.optString("car_damage_id");
            damage_pos_type = jsonObject.optString("damage_pos_type");
            pos_no = jsonObject.optString("pos_no");
            damage_image = new Image().parse(jsonObject.optJSONObject("damage_image"));
            return this;
        }
        return null;
    }
}
